package com.project.class4_12.lambda;

import com.lovo.netCRM.component.LovoButton;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class MyJFrame extends JFrame {
    public MyJFrame(){
        this.setLayout(null);
        LovoButton add = new LovoButton("添加",20,30,this);
        add.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("执行添加操作");
            }
        });

        LovoButton del = new LovoButton("删除",120,30,this);
        del.addActionListener(e -> {
                    System.out.println("执行删除操作");
            System.out.println("Lambda表达式");
                }
        );

        this.setSize(400,300);
        this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
    }
    public static void main(String[] args) {
        new MyJFrame();
    }
}
